<!-- include tpl=head_lay -->
<script type="text/javascript">
function save()
{
	$("#post_save").ajaxSubmit({
		'url':get_url('weixin','subscribe_save'),
		'type':'post',
		'dataType':'json',
		'success':function(rs){
			if(rs.status){
				$.dialog.alert('操作成功',function(){
					$.phpok.reload();
				},'succeed');
				return true;
			}
			$.dialog.alert(rs.info);
			return false;
		}
	});
	return false;
}
</script>
<form method="post" class="layui-form" id="post_save" onsubmit="return save()">
<div class="layui-card">
	<div class="layui-card-header">
		订阅设置
	</div>
	<div class="layui-card-body">
		<div class="layui-form-item">
			<label class="layui-form-label">
				欢迎语
			</label>
			<div class="layui-input-block gray" style="line-height:38px;">
				仅支持简单的HTML，可使用标识
				<span class="layui-btn layui-btn-xs layui-btn-primary phpok-copy" data-clipboard-text="[昵称]" title="点击复制">[昵称]</span>
				<span class="layui-btn layui-btn-xs layui-btn-primary phpok-copy" data-clipboard-text="[账号]" title="点击复制">[账号]</span>
				<span class="layui-btn layui-btn-xs layui-btn-primary phpok-copy" data-clipboard-text="[密码]" title="点击复制">[密码]</span>
			</div>
			<div class="layui-input-block">
				<textarea name="welcome" id="welcome" class="layui-textarea">{$welcome}</textarea>
			</div>
		</div>
		
		<div class="layui-form-item">
			<label class="layui-form-label">
				账号规则
			</label>
			<div class="layui-input-inline default-auto">
				<input type="text" name="account" id="account" value="{$wxconfig.account}" class="layui-input" />
				<div class="layui-btn-group" style="margin-top:5px;">
					<input type="button" value="微信前缀" onclick="$.phpokform.text_button_quickwords('account','wx','')" class="layui-btn layui-btn-sm" />
					<input type="button" value="时间戳" onclick="$.phpokform.text_button_quickwords('account','[time]','')" class="layui-btn layui-btn-sm" />
					<input type="button" value="微信昵称" onclick="$.phpokform.text_button_quickwords('account','[nickname]','')" class="layui-btn layui-btn-sm" />
					<input type="button" value="随机数" onclick="$.phpokform.text_button_quickwords('account','[rand]','')" class="layui-btn layui-btn-sm" />
					<input type="button" value="用户ID" onclick="$.phpokform.text_button_quickwords('account','[uid]','')" class="layui-btn layui-btn-sm" />
					<input type="button" value="分割符" onclick="$.phpokform.text_button_quickwords('account','-','')" class="layui-btn layui-btn-sm" />
				</div>
			</div>
			<div class="layui-form-mid">
				关注公众号后自动生成用户账号规则
			</div>
		</div>
		<div class="layui-form-item">
			<label class="layui-form-label">
				默认密码
			</label>
			<div class="layui-input-inline">
				<input type="text" name="password" id="password" value="{$wxconfig.password}" class="layui-input" />
			</div>
			<div class="layui-input-inline auto gray lh38">
				<div class="layui-btn-group">
					<input type="button" value="时间戳" onclick="$.phpokform.text_button_quickwords('password','[time]','')" class="layui-btn layui-btn-sm" />
					<input type="button" value="随机数" onclick="$.phpokform.text_button_quickwords('password','[rand]','')" class="layui-btn layui-btn-sm" />
				</div>
			</div>
			<div class="layui-form-mid">
				关注公众号后自动生成账号及密码
			</div>
		</div>
	</div>
</div>
<div class="layui-card">
	<div class="layui-card-header">
		取消订阅
	</div>
	<div class="layui-card-body">
		<div class="layui-form-item">
			<label class="layui-form-label">
				用户状态
			</label>
			<div class="layui-input-inline auto">
				<input type="radio" name="is_del" id="is_del" value="0" {if !$wxconfig.is_del} checked{/if} title="忽略" />
				<input type="radio" name="is_del" id="is_del" value="1" {if $wxconfig.is_del} checked{/if} title="删除" />
			</div>
			<div class="layui-form-mid">
				取消关注后同时删除用户信息
			</div>
		</div>
	</div>
</div>
<div class="submit-info-clear"></div>
<div class="submit-info">
	<div class="layui-container center">
		<input type="submit" value="{lang保存设置}" class="layui-btn layui-btn-danger" id="save_button" />
		<input type="button" value="{lang关闭}" class="layui-btn layui-btn-primary" onclick="$.admin.close()" />
	</div>
</div>

</form>
<!-- include tpl=foot_lay -->